﻿using System.Web;
using System.Web.Optimization;

namespace TimeTracker.WebUI
{
    public class BundleConfig
    {
        // For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkId=254725
        public static void RegisterBundles(BundleCollection bundles)
        {
            bundles.UseCdn = false;

            bundles.IgnoreList.Clear();
            bundles.IgnoreList.Ignore("*-vsdoc.js");
            bundles.IgnoreList.Ignore("*intellisense.js");

            // modernizer
            bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
                        "~/Scripts/lib/modernizr-{version}.js"));

            // jQuery
            bundles.Add(new ScriptBundle("~/bundles/jquery",
                "//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js")
                .Include("~/Scripts/lib/jquery-{version}.js"));

            bundles.Add(new ScriptBundle("~/bundles/jsextlibs")
                .Include(
                    "~/Scripts/lib/json2.js",

                    "~/Scripts/lib/jquery.activity-indicator-{version}.js",
                    "~/Scripts/lib/TrafficCop.js",
                    "~/Scripts/lib/infuser.js",

                    "~/Scripts/lib/knockout-{version}.js",
                    "~/Scripts/lib/knockout.validation.js",

                    "~/Scripts/lib/underscore.js",
                    "~/Scripts/lib/moment.js",
                    "~/Scripts/lib/sammy.js",
                    "~/Scripts/lib/amplify.js",
                    "~/Scripts/lib/toastr.js"
                ));
            bundles.Add(new ScriptBundle("~/bundles/jsmocks")
                .IncludeDirectory("~/Scripts/app/mock/", "*.js", searchSubdirectories: false));

            bundles.Add(new ScriptBundle("~/bundles/jsapplibs").
                IncludeDirectory("~/Scripts/app/", "*.js", 
                searchSubdirectories: false));

            bundles.Add(new StyleBundle("~/Content/css").
                Include(
                    "~/Content/normalize.css",
                    "~/Content/main.css",
                    "~/Content/toastr.css"
                    ));

            bundles.Add(new Bundle("~/Content/less", new LessTransform(), new CssMinify())
                .Include("~/Content/styles.less"));
        }
    }
}